﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<link rel="stylesheet" href="../../Content/silver/sys_style.css" type="text/css" />
<script type="text/javascript" src="../../Scripts/siteservercore.js"></script>

</head>
<body class="bg_fa">
<div class="lefttab">
<div id="xmname"></div>
</div>
<div class="left_menu">
<form name="ctl00" method="post" action="#" id="ctl00">
 

 
 
 
<dl>

<%
User user = (User)ViewData["user"];
System.Collections.Generic.IEnumerable<Factory> factories = (System.Collections.Generic.IEnumerable<Factory>)ViewData["factories"];
if (user == null)
{
%>
<script type="text/javascript">
    window.parent.location = "/Account/LogOn";
</script>
<%
    return;
}
if (user.RoleId == (int)RoleEnum.Administrator)
{
    foreach(Factory factory in factories)
    {
%>

<dt><label class="icon_06">
    <%=factory.Name%></label>
</dt>

<%
        if (factory.Stacks != null && factory.Stacks.Count > 0)
        {
            foreach (GabageFactory.Models.Stack s in user.Factory.Stacks)
            {
%> 

<dd>
    <%= Html.ActionLink(s.Name, "Edit", "Stack", new { id = s.Id }, new { target = "right", isTreeLink = "true" })%>
</dd>

<%
            }
        }

    if (factory.Tailingponds != null && factory.Tailingponds.Count > 0)
        {
            foreach (GabageFactory.Models.Tailingpond t in user.Factory.Tailingponds)
            {
%> 

<dd>
    <%= Html.ActionLink(t.Name, "Edit", "Stack", new { id = t.Id }, new { target = "right", isTreeLink = "true" })%>
</dd>

<%
            }
        }
    }
%>

<dt><label class="icon_10">系统管理</label></dt>
 
<dd>
    <%= Html.ActionLink("公司管理", "Index", "Factory", null, new { target = "right", isTreeLink = "true" })%>
</dd>

<dd>
    <%= Html.ActionLink("堆场管理", "Index", "Stack", null, new { target = "right", isTreeLink = "true" })%>
</dd>

<dd>
    <%= Html.ActionLink("尾矿库管理", "Index", "Tailingpond", null, new { target = "right", isTreeLink = "true" })%>
</dd>

<dt><label class="icon_05">修改历史数据</label></dt>

<dd>
    <%--<%= Html.ActionLink("申请列表(" + ViewData["newApplyCount"] + ")", "Index", "Modification", null, new { target = "right", isTreeLink = "true" })%>--%>
    <a href='<%= Url.Content("~/Modification/Index") %>' target="right">申请列表 <%if (((int)ViewData["newApplyCount"]) > 0) { %>(<strong class="colorRed"><%= ViewData["newApplyCount"]%></strong>)<%} %></a>
</dd>  

<dt><label class="icon_03">用户管理</label></dt>
 
<dd>
    <%= Html.ActionLink("用户管理", "Index", "User", null, new { target = "right", isTreeLink = "true" })%>
</dd>

<dt><label class="icon_02">通知管理</label></dt>
 
<dd>
    <%= Html.ActionLink("通知管理", "Index", "Message", null, new { target = "right", isTreeLink = "true" })%>
</dd>
<%
}

if (user.RoleId == (int)RoleEnum.Recorder)
{
%>

<dt>
    <label class="icon_06"><%=user.Factory.Name%></label>
</dt>

<dd>
    <%= Html.ActionLink("气象信息", "FactoryWeather", "Record", new { id = user.Factory.Id }, new { target = "right", isTreeLink = "true" })%>
</dd>

<%
    if (user.Factory.Stacks != null && user.Factory.Stacks.Count > 0)
    {
        foreach (GabageFactory.Models.Stack s in user.Factory.Stacks)
        {
%> 

<dd>
    <%= Html.ActionLink(s.Name, "StackWater", "Record", new { id = s.Id }, new { target = "right", isTreeLink = "true" })%>
</dd>

<%
        }
    }

    if (user.Factory.Tailingponds != null && user.Factory.Tailingponds.Count > 0)
    {
        foreach (GabageFactory.Models.Tailingpond t in user.Factory.Tailingponds)
        {
%> 

<dd>
    <%= Html.ActionLink(t.Name, "TailingpondWater", "Record", new { id = t.Id }, new { target = "right", isTreeLink = "true" })%>
</dd>

<%
        }
    }
%>

<dt><label class="icon_05">修改历史数据</label></dt>


<dd>
    <%--<%= Html.ActionLink("申请列表(" + ViewData["newApplyCount"] + ")", "OwnedIndex", "Modification", null, new { target = "right", isTreeLink = "true" })%>--%>

    <a href='<%= Url.Content("~/Modification/OwnedIndex") %>' target="right">申请列表 <%if (((int)ViewData["newApplyCount"]) > 0) { %>(<strong class="colorRed"><%= ViewData["newApplyCount"]%></strong>)<%} %></a>
</dd>

<%
}
    if (user.RoleId == (int)RoleEnum.Auditor || user.RoleId == (int)RoleEnum.Manager)
{
%>

<dt>
    <label class="icon_06"><%=user.Factory.Name%></label>
</dt>

<%
    if (user.Factory.Stacks != null && user.Factory.Stacks.Count > 0)
    {
        foreach (GabageFactory.Models.Stack s in user.Factory.Stacks)
        {
%> 

<dd>
    <%= Html.ActionLink(s.Name, "Details", "Stack", new { id = s.Id }, new { target = "right", isTreeLink = "true" })%>
</dd>


<%
        }
    }

    if (user.Factory.Tailingponds != null && user.Factory.Tailingponds.Count > 0)
    {
        foreach (GabageFactory.Models.Tailingpond t in user.Factory.Tailingponds)
        {
%> 

<dd>
    <%= Html.ActionLink(t.Name, "Details", "Tailingpond", new { id = t.Id }, new { target = "right", isTreeLink = "true" })%>
</dd>

<%
        }
    }
}

if (user.RoleId == (int)RoleEnum.Analyzer)
{
%>

<dd>
    <%=user.Factory.Name%>
</dd>

<dt>
    <label class="icon_06"><%=user.Factory.Name%></label>
</dt>

<%
    if (user.Factory.Stacks != null && user.Factory.Stacks.Count > 0)
    {
        foreach (GabageFactory.Models.Stack s in user.Factory.Stacks)
        {
%> 

<dd>
    <%= Html.ActionLink(s.Name, "Index", "Analyze", new { id = s.Id }, new { target = "right", isTreeLink = "true" })%>
</dd>

<%
        }
    }

    if (user.Factory.Tailingponds != null && user.Factory.Tailingponds.Count > 0)
    {
        foreach (GabageFactory.Models.Tailingpond t in user.Factory.Tailingponds)
        {
%> 

<dd>
    <%= Html.ActionLink(t.Name, "Index", "Analyze", new { id = t.Id }, new { target = "right", isTreeLink = "true" })%>
</dd>
<%
        }
    }
}



    if (user.RoleId == (int)RoleEnum.Recorder || user.RoleId == (int)RoleEnum.Analyzer || user.RoleId == (int)RoleEnum.Auditor || user.RoleId == (int)RoleEnum.Expert || user.RoleId == (int)RoleEnum.Manager)
    {
%>

<dt><label class="icon_13">查询历史数据</label></dt>

<dd>
    <%= Html.ActionLink("查询历史数据", "Index", "Query", null, new { target = "right", isTreeLink = "true" })%>
</dd>

<dt><label class="icon_04">测量数据图表</label></dt>

<dd>
    <%= Html.ActionLink("气象测量数据图表", "Index", "Graph", new { graphType=GabageFactory.Controllers.GraphController.GraphType.Weather}, new { target = "right", isTreeLink = "true" })%>
</dd>

<dd>
    <%= Html.ActionLink("堆场测量数据图表", "Index", "Graph", new { graphType=GabageFactory.Controllers.GraphController.GraphType.Stack}, new { target = "right", isTreeLink = "true" })%>
</dd>

<dd>
    <%= Html.ActionLink("尾矿库测量数据图表", "Index", "Graph", new { graphType=GabageFactory.Controllers.GraphController.GraphType.Tailingpond}, new { target = "right", isTreeLink = "true" })%>
</dd>  
    

<%
    }
    
    
    if (user.RoleId == (int)RoleEnum.Auditor)
    {
%>

<dt><label class="icon_05">修改历史数据</label></dt>

<dd>
    <%--<%= Html.ActionLink("申请列表(" + ViewData["newApplyCount"] + ")", "FactoryIndex", "Modification", null, new { target = "right", isTreeLink = "true" })%>--%>
    <a href='<%= Url.Content("~/Modification/FactoryIndex") %>' target="right">申请列表 <%if (((int)ViewData["newApplyCount"]) > 0) { %>(<strong class="colorRed"><%= ViewData["newApplyCount"]%></strong>)<%} %></a>
</dd>
  
<%
}
if (user.RoleId == (int)RoleEnum.Expert || user.RoleId == (int)RoleEnum.Analyzer || user.RoleId == (int)RoleEnum.Auditor || user.RoleId == (int)RoleEnum.Manager)
{
%>

<dt><label class="icon_14">分析报告</label></dt>
<%if (user.RoleId == (int)RoleEnum.Expert) { %>
<dd>
    <%= Html.ActionLink("分配分析报告", "List", "Reporting", null, new { target = "right", isTreeLink = "true" })%>
</dd>
<%
}
if (user.RoleId == (int)RoleEnum.Analyzer)
{
%>
<dd>
    <%= Html.ActionLink("填写分析报告", "Own", "Reporting", null, new { target = "right", isTreeLink = "true" })%>
</dd>
<%
}
    if (user.RoleId == (int)RoleEnum.Auditor || user.RoleId == (int)RoleEnum.Manager)
{
%>
<dd>
    <%= Html.ActionLink("年度分析报告", "History", "Reporting", null, new { target = "right", isTreeLink = "true" })%>
</dd>
<%
}
%>
<dd>
    <%= Html.ActionLink("查询分析报告", "Query", "Reporting", null, new { target = "right", isTreeLink = "true" })%>
</dd>
<%
}
if (user.RoleId == (int)RoleEnum.Recorder || user.RoleId == (int)RoleEnum.Expert || user.RoleId == (int)RoleEnum.Analyzer || user.RoleId == (int)RoleEnum.Auditor || user.RoleId == (int)RoleEnum.Manager)
{
%>

    <dt><label class="icon_17">事件处理</label></dt>
    <%if (user.RoleId == (int)RoleEnum.Recorder || user.RoleId == (int)RoleEnum.Expert) { %>
    <dd>
        <%= Html.ActionLink("新建现场事件", "Create", "Event", null, new { target = "right", isTreeLink = "true" })%>
    </dd>
    <%
    }
        if (user.RoleId == (int)RoleEnum.Recorder || user.RoleId == (int)RoleEnum.Auditor)
        {
    %>
    <dd>
        <%--<%= Html.ActionLink("正在处理中事件(" + ViewData["newEventCount"] + ")", "List", "Event", new { status = 0 }, new { target = "right", isTreeLink = "true" })%>--%>
        <a href='<%= Url.Content("~/Event/List?status=0") %>' target="right">正在处理中事件 <%if (((int)ViewData["newEventCount"]) > 0) { %>(<strong class="colorRed"><%= ViewData["newEventCount"]%></strong>)<%} %></a>
    </dd>
    <dd>
        <%--<%= Html.ActionLink("待确认结束事件(" + ViewData["processingEventCount"] + ")", "List", "Event", new { status = 1 }, new { target = "right", isTreeLink = "true" })%>--%>

        <a href='<%= Url.Content("~/Event/List?status=1") %>' target="right">待确认结束事件 <%if (((int)ViewData["processingEventCount"]) > 0) { %>(<strong class="colorRed"><%= ViewData["processingEventCount"]%></strong>)<%} %></a>
    </dd>
    <dd>
        <%= Html.ActionLink("已确认结束事件", "Search", "Event", null, new { target = "right", isTreeLink = "true" })%>
    </dd>
    <%
        }
        if (user.RoleId == (int)RoleEnum.Manager || user.RoleId == (int)RoleEnum.Analyzer || user.RoleId == (int)RoleEnum.Expert)
        {
    %>
    <dd>
        <%= Html.ActionLink("查看正在跟踪事件", "OnTrack", "Event", null, new { target = "right", isTreeLink = "true" })%>
    </dd>
    <dd>
        <%= Html.ActionLink("查询确认结束事件", "Search", "Event", null, new { target = "right", isTreeLink = "true" })%>
    </dd>
    <%
        }
}  
if (user.RoleId == (int)RoleEnum.Recorder || user.RoleId == (int)RoleEnum.Expert || user.RoleId == (int)RoleEnum.Analyzer || user.RoleId == (int)RoleEnum.Auditor || user.RoleId == (int)RoleEnum.Manager)
{
%>

    <dt><label class="icon_18">固定位置图片</label></dt>
    <dd>
        <%= Html.ActionLink("固定位置图片", "Search", "Position", null, new { target = "right", isTreeLink = "true" })%>
    </dd>

    <%
}  
if (user.RoleId != (int)RoleEnum.Administrator)
{
%>

<dt><label class="icon_03">用户管理</label></dt>

<dd>
    <%= Html.ActionLink("修改密码", "RequestChangePwd", "User", null, new { target = "right", isTreeLink = "true" })%>
</dd>

<dt><label class="icon_02">系统通知</label></dt>
<%
    if (user.RoleId == (int)RoleEnum.Auditor || user.RoleId == (int)RoleEnum.Expert)
{ 
%>
<dd>
    <%= Html.ActionLink("通知管理", "Index", "Message", null, new { target = "right", isTreeLink = "true" })%>
</dd> 
<%
    }
%>
<dd><%= Html.ActionLink("最新通知", "Message", "Home", null, new { target = "right", isTreeLink = "true" })%></dd>

<%
    }
%>
 
</dl>

</form>
</div>
 
</body>
</html>
